import React from 'react'
import PropTypes from 'prop-types'
import {
  StyleSheet,
  Text
} from 'react-native'
import { ScaleS, ScaleT } from 'src/utils/ScreenUtil'
import CustomButton from './CustomButton'
export default class NextButton extends React.PureComponent {
  static propTypes = {
    style: PropTypes.object,
    title: PropTypes.string,
    enable: PropTypes.bool,
    onPress: PropTypes.func
  }

  render () {
    const { title, style, onPress, enable } = this.props
    return (
      <CustomButton style={[style, styles.button, enable && styles.buttonEnable]} onPress={onPress}>
        <Text style={[styles.title, enable && styles.titleEnable]}>{title}</Text>
      </CustomButton>
    )
  }
}

const styles = StyleSheet.create({
  button: {
    width: ScaleS(312),
    height: ScaleS(50),
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#EBEBEB',
    borderRadius: ScaleS(5)
  },
  buttonEnable: {
    backgroundColor: '#000000'
  },
  title: {
    fontSize: ScaleT(16),
    color: '#999999',
    fontWeight: '500'
  },
  titleEnable: {
    color: '#FFFFFF'
  }
})
